<%@page import="java.sql.*" %>
<%@page import="MY.Lj"  %>
<%@page language="java" import="java.util.*" pageEncoding="utf-8"%>
<html>
<head>
    <title>登陆检测</title>
</head>
<body>
<%
    String user = request.getParameter("user");
    String pass = request.getParameter("password");
    String pass2 = request.getParameter("password2");
    
    if(!pass.equals(pass2)){
    
    out.println("<script>");
    out.println("alert('登录失败！！！两次密码不一样')");
    out.println("window.location ='/shopping/login.jsp';");
    out.println("</script>");
    
    }else if(pass.equals(pass2))
    {
    Connection con=Lj.getConnection();
    Statement stmt=con.createStatement();
    stmt.executeUpdate(String.format("insert into do(user,pass) values('%s','%s')",user,pass));
    out.println("<script>");
    out.println("alert('注册成功！！！')");
    out.println("window.location ='/Mysql123456/index.jsp';");
    out.println("</script>");
    }
    
     %>
</body>
</html>